#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>

int main()
{
    umask(0);
    int id = open("text.txt",O_WRONLY|O_TRUNC|O_CREAT,0666);
    char* str = "hello world";
    write(id,str,strlen(str));
    return 0;
}